package com.wymobilearchitecture.demo;

import java.lang.reflect.Field;

public class Test {

    public static void main(String[] args) {

        System.out.println("0%2: " + 2%5);
        B b = new B();
        b.pri();
        b.m();
        b.pri();
    }

    static class A{
        private String str = "a";

        public void pri(){
            System.out.println(str);
        }
    }

    static class B extends A{

        public void m(){
            Field field = null;
            try {
                field = A.class.getDeclaredField("str");
                field.setAccessible(true);
                field.set(B.this,"b");
            } catch (Exception e) {
                e.printStackTrace();
            }



        }
    }
}
